﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

	<%@ include file="/WEB-INF/include/meta.jsp"%>
	<%@ include file="/WEB-INF/include/css.jsp"%>
	
	<link href="${ctx.resource}/css/shiftform.css" rel="stylesheet">
	<link href="${ctx.resource}/css/select2.css" rel="stylesheet">
	<link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
	
	<title></title>

</head>

<body>

	<%@ include file="/WEB-INF/include/header.jsp"%>

	<%@ include file="/WEB-INF/include/menu.jsp"%>

	<div class="container main-content">

		<div class="panel panel-default beast-panel beast-panel-layout">

			<div class="panel-heading">
				<ol class="breadcrumb">
					<li><a href="${ctx.host}/customer">任务管理</a></li>
					<li class="active">用户任务管理</li>
				</ol>
			</div>

			<div class="panel-body">

				<div class="col-xs-2 beast-panel-layout-left no-horizontal-padding">
					<%@ include file="/WEB-INF/include/submenu.jsp"%>
				</div>

				<div class="col-xs-10 beast-panel-layout-right">

					<div class="beast-breadcrumb-wrapper">
						<div class="beast-breadcrumb clearfix">
							<h2>
								<i class="glyphicon glyphicon-fire" title="用户任务管理"></i>&nbsp;&nbsp;<span>用户任务管理&nbsp;-&nbsp;用户任务详情</span>
							</h2>
						</div>
					</div>

					<div class="beast-toolbar-wrapper top-margin-20 clearfix">
						<div class="text-right"
							style="padding-top: 10px; padding-bottom: 10px; border-bottom: 2px solid #CCC;">
							<button type="button"
								class="btn btn-default btn-shadow btn-shadow-default demo2do-btn"
								onclick="window.location.href='${ctx.host}/tasks'">
								<i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回
							</button>
						</div>
					</div>

					<div class="beast-breadcrumb-wrapper top-margin-20">
						<div class="beast-breadcrumb yellow clearfix">
							<h2>
								<span>任务基本信息</span>
							</h2>
						</div>
					</div>

					<div class="form-horizontal bottom-margin-20">
						<div class="form-group">
							<label class="col-xs-2 control-label">用户编号：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.id }</p>
							</div>
							<label class="col-xs-2 control-label">用户名称：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.customer.profile.nickName }</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-2 control-label">创建时间：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<fmt:formatDate value="${task.startDate }"
										pattern="yyyy-MM-dd HH:mm:ss" />
								</p>
							</div>
							<label class="col-xs-2 control-label">任务状态：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<span class="text-${task.taskStatus.css}">${task.taskStatus.alias}</span>
								</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-2 control-label">投放平台：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.advertisement.socialType.description }</p>
							</div>
							<label class="col-xs-2 control-label">可获酬金：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.reward/100}&nbsp;元</p>
							</div>
						</div>
					</div>

					<c:if
						test="${ (task.taskStatus eq 'DONE') or (task.taskStatus eq 'FINISH')}">

						<div class="beast-breadcrumb-wrapper top-margin-20">
							<div class="beast-breadcrumb yellow clearfix">
								<h2>
									<span>审核信息</span>
								</h2>
							</div>
						</div>

						<div class="form-horizontal bottom-margin-20">
							<div class="form-group">
								<label class="col-xs-2 control-label">审核图片：</label>
								<div class="col-xs-10">
									<div class="col-xs-4">
										<img alt="" src="${ctx.qiniu}/${task.screenshot}!600">
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-2 control-label">审核人：</label>
								<div class="col-xs-4 pull-left">
									<p class="form-control-static">${task.auditor }</p>
								</div>
								<label class="col-xs-2 control-label">审核时间：</label>
								<div class="col-xs-4 pull-left">
									<p class="form-control-static">
										<fmt:formatDate value="${task.auditDate }"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-xs-2 control-label">审核结果：</label>
								<div class="col-xs-4 pull-left">
									<p class="form-control-static">${task.taskStatus.alias }</p>
								</div>
							</div>
						</div>

					</c:if>

					<div class="beast-breadcrumb-wrapper top-margin-20">
						<div class="beast-breadcrumb yellow clearfix">
							<h2>
								<span>广告信息</span>
							</h2>
						</div>
					</div>

					<div class="form-horizontal bottom-margin-20">

						<div class="form-group demo2do-form-group">
							<label class="col-xs-10 control-label" style="text-align: left;"><strong>基本信息&nbsp;&nbsp;&nbsp;&nbsp;</strong></label>
						</div>

						<div class="form-group top-margin-20">
							<label class="col-xs-2 control-label">投放名称：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.advertisement.adTitle }</p>
							</div>
							<label class="col-xs-2 control-label">广告主名：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<a href="${task.advertisement.aduser.company.website }"
										target="_BLANK">${task.advertisement.aduser.profile.userName }</a>
								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-xs-2 control-label">创建时间：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<fmt:formatDate value="${task.advertisement.createDate}"
										pattern="yyyy-MM-dd" />
								</p>
							</div>
							<label class="col-xs-2 control-label">投放时间：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<fmt:formatDate value="${task.advertisement.startDate }"
										pattern="yyyy-MM-dd" />
									&nbsp;-&nbsp;
									<fmt:formatDate value="${task.advertisement.endDate }"
										pattern="yyyy-MM-dd" />
								</p>
							</div>
						</div>

						<div class="form-group demo2do-form-group">
							<label class="col-xs-10 control-label" style="text-align: left;"><strong>投放要求&nbsp;&nbsp;&nbsp;&nbsp;</strong></label>
						</div>

						<div class="form-group">
							<label class="col-xs-2 control-label">投放平台：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.advertisement.socialType.description }</p>
							</div>
							<label class="col-xs-2 control-label">投放目标：</label>
							<div class="col-xs-4 pull-left">
								<c:choose>
									<c:when test="${task.advertisement.type eq 'BUDGET'}">
										<p class="form-control-static">${task.advertisement.putNumber}&nbsp;元</p>
									</c:when>
									<c:when test="${task.advertisement.type eq 'QUANTITY'}">
										<p class="form-control-static">${task.advertisement.putNumber}&nbsp;阅读量</p>
									</c:when>
								</c:choose>
							</div>
						</div>

						<div class="form-group">
							<label class="col-xs-2 control-label">投放类型：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.advertisement.type.description}</p>
							</div>
							<label class="col-xs-2 control-label">已认领：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">${task.advertisement.claimNumber}&nbsp;认领</p>
							</div>
						</div>

						<div class="form-group demo2do-form-group">
							<label class="col-xs-10 control-label" style="text-align: left;"><strong>投放标签&nbsp;&nbsp;&nbsp;&nbsp;</strong></label>
						</div>

						<div class="form-group top-margin-20">
							<label class="col-xs-2 control-label">兴趣标签：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<c:forEach var="interestTagCode"
										items="${task.advertisement.advertisementTag.stringInterestTagCodes}">
										<label class="label label-outline label-info">${persist.interestTags[interestTagCode].name}</label>
									</c:forEach>
								</p>
							</div>
							<label class="col-xs-2 control-label">生活标签：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<c:forEach var="lifeTagCode"
										items="${task.advertisement.advertisementTag.stringLifeTagCodes}">
										<label class="label label-outline label-info">${persist.lifeTags[lifeTagCode].name}</label>
									</c:forEach>
								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-xs-2 control-label">性别标签：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<c:forEach var="sexTagCode"
										items="${task.advertisement.advertisementTag.stringSexTag}">
										<label class="label label-outline label-info">${persist.sexTags[sexTagCode].name}</label>
									</c:forEach>
								</p>
							</div>
							<label class="col-xs-2 control-label">地域标签：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<c:forEach var="areaTagCode"
										items="${task.advertisement.advertisementTag.stringAreaTag}">
										<label class="label label-outline label-info">${persist.areaTags[areaTagCode].name}</label>
									</c:forEach>
								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-xs-2 control-label">年龄标签：</label>
							<div class="col-xs-4 pull-left">
								<p class="form-control-static">
									<c:forEach var="ageTagCode"
										items="${task.advertisement.advertisementTag.stringAgeTag}">
										<label class="label label-outline label-info">${persist.ageTags[ageTagCode].name}</label>
									</c:forEach>
								</p>
							</div>
						</div>

						<div class="form-group demo2do-form-group">
							<label class="col-xs-10 control-label" style="text-align: left;"><strong>广告素材&nbsp;&nbsp;&nbsp;&nbsp;</strong></label>
						</div>

						<div class="form-group top-margin-20">
							<label class="col-xs-2 control-label">文字描述：</label>
							<div class="col-xs-9 col-xs-offset-2">
								<p class="form-control-static">${task.advertisement.material.description }</p>
							</div>
						</div>

						<c:choose>
							<c:when
								test="${task.advertisement.material.type.name eq 'GRAPHIC'}">
								<div class="form-group">
									<label class="col-xs-2 control-label">图文素材：</label>
									<div class="col-xs-9 col-xs-offset-2">
										<div class="row">
											<c:forEach var="materialImage"
												items="${task.advertisement.material.materialImages}">
												<div class="col-md-2">
													<img alt="" src="${ctx.qiniu}/${materialImage.image}!200">
												</div>
											</c:forEach>
										</div>
									</div>
								</div>
							</c:when>
							<c:otherwise>
								<div class="form-group">
									<label class="col-xs-2 control-label">链接素材：</label>
									<div class="col-xs-9 col-xs-offset-2">
										<textarea class="form-control" rows="3" readonly>${task.advertisement.material.link}</textarea>
									</div>
								</div>
							</c:otherwise>
						</c:choose>

					</div>

				</div>

			</div>

		</div>
	</div>
	<%@ include file="/WEB-INF/include/footer.jsp"%>
	<%@ include file="/WEB-INF/include/script.jsp"%>
	<script src="${ctx.resource}/js/shiftform.js"></script>
	<script src="${ctx.resource}/js/select2.min.js"></script>
	<script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
</body>

</html>
